package com.emspost.utils;

import java.util.Random;

public class SleepUtils {

    /**
     * 随机随眠 5- 10S
     */
    public static void randomSleep() {
        Random random = new Random();
        // 生成5000-10000ms之间的随机时间（5-10秒）
        int sleepTime = random.nextInt(5001) + 5000;
        
        try {
            System.out.println("随机睡眠时间: " + sleepTime + "ms");
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            System.err.println("睡眠被中断: " + e.getMessage());
        }
    }
}